__author__ = 'aesop'
#coding:utf-8

from flask import session
from flask import request
import models.group as stu_group
import libs.util.json_enable_chinese as json

def group_route(app):
    @app.route('/note/group/list', methods=['GET'])
    def group_list():
        stu_id = session['stu_id']
        result = stu_group.get_group_list(stu_id)
        return json.json_aesop.encode(result)

    @app.route('/note/group/add',methods=['POST'])
    def add_group():
        stu_id = session['stu_id']
        group_name = request.form['group_name']
        group_list = request.form['group_list']